<?php
    include_once("../inc/login_controll.inc.php");
	include_once("../class/config.class.php"); 
	$config = config::getConfig();
	include_once($config->getValue("home_path")."/inc/defines.inc.php");

	include_once(HOME_PATH."/class/form.class.php");
	include_once(HOME_PATH."/class/database.class.php");
	include_once(HOME_PATH."/class/user.class.php");
	
	$oForm = new form($config);
	$oDB = new database($config);
	$oForm->setDB($oDB);
	
	include(HOME_PATH."/templates/header.tpl.php");

	if(isset($_GET['f']) && is_numeric($_GET['f'])){
		$iFormId = (int)$_GET['f'];
	}
	// Alle Fragen der Umfrage auslesen
	$aQuestions = $oForm->getQuestionsByForm($iFormId);

	// Durchschnittswerte berechnen
	$aResultsOveral = $oForm->getResults($iFormId);
	
	// Einzelne Werte berechnen
	$aDistinctResults = $oForm->getDistinctResults($iFormId);
		
	include(HOME_PATH."/templates/admin/result.tpl.php");	
	include(HOME_PATH."/templates/footer.tpl.php");
?>

